#!/usr/bin/perl -w
# Task D (3 points)
# Write a program that takes two fictive protein names and sequences 
# as input from the user and stores them in a hash. Use the names as keys and 
# the sequences as values. The program should then ask for yet another protein name 
# and print the associated sequence if it exists in the hash.
#
# initialize the hash
my $hash = (); 
# Get two numbers from user
print "Please give the name of first protein ";
$protein_name1 = <STDIN>;chomp($protein_name1);
print "Please give the first sequence ";
$protein_sequence1 = <STDIN>;chomp($protein_sequence1);
$hash{ $protein_name1 } = $protein_sequence1;
print "Please give the name of second protein ";
$protein_name2 = <STDIN>;chomp($protein_name2);
print "Please give the  second sequence ";
$protein_sequence2 = <STDIN>;chomp($protein_sequence2);
$hash{ $protein_name2 } = $protein_sequence2; 
# Ask for protein name
print "Please give the name of a protein ";
$protein_name = <STDIN>; chomp($protein_name);
if  (exists $hash{$protein_name}) {print "The sequence associated to protein $protein_name is: $hash{$protein_name}";}
else {
	print "$protein_name does not have a sequence associated to it.";
} 

 


